package com.qying.rpc.registry;

import com.qying.rpc.common.ServiceMeta;

import java.io.IOException;

public interface RegistryService {

    /**
     * 注册
     * @param serviceMeta 元数据
     * @throws Exception
     */
    void register(ServiceMeta serviceMeta) throws Exception;

    /**
     * 注销
     * @param serviceMeta
     * @throws Exception
     */
    void unRegister(ServiceMeta serviceMeta) throws Exception;

    /**
     * 服务发现
     * @param serviceName 服务名称
     * @param invokerHashCode hash
     * @return
     * @throws Exception
     */
    ServiceMeta discovery(String serviceName, int invokerHashCode) throws Exception;

    /**
     * 服务销毁
     * @throws IOException
     */
    void destory() throws IOException;


}
